Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PyQt4 and PySide support #512

Merged
merged 15 commits into from
May 11, 2020
Merged

Conversation

corranwebster
Copy link
Contributor

@corranwebster corranwebster commented Apr 27, 2020

A start along the road to do #510. This removes PyQt4 and PySide support from etstool, Travis and Appveyor. Drive-by clean-up fixes mock dependencies as well and fixes unrelated wxPython CI failures from new wxPython release.

@codecov-io
Copy link

codecov-io commented Apr 28, 2020

Codecov Report

Merging #512 into master will decrease coverage by 0.10%.
The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #512      +/-   ##
==========================================
- Coverage   36.94%   36.84%   -0.11%     
==========================================
  Files         470      470              
  Lines       25997    25921      -76     
  Branches     3955     3931      -24     
==========================================
- Hits         9604     9550      -54     
+ Misses      15969    15955      -14     
+ Partials      424      416       -8     
Impacted Files Coverage Δ
pyface/__init__.py 71.42% <ø> (ø)
pyface/ui/qt4/workbench/split_tab_widget.py 12.47% <50.00%> (ø)
pyface/qt/__init__.py 40.74% <80.00%> (-9.26%) ⬇️
pyface/qt/QtCore.py 100.00% <100.00%> (+22.22%) ⬆️
pyface/qt/QtGui.py 100.00% <100.00%> (+9.52%) ⬆️
pyface/qt/QtMultimedia.py 100.00% <100.00%> (ø)
pyface/qt/QtMultimediaWidgets.py 100.00% <100.00%> (ø)
pyface/qt/QtNetwork.py 100.00% <100.00%> (+25.00%) ⬆️
pyface/qt/QtOpenGL.py 100.00% <100.00%> (+25.00%) ⬆️
pyface/qt/QtSvg.py 100.00% <100.00%> (+25.00%) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1f4bdc...93f8f34. Read the comment docs.

@corranwebster
Copy link
Contributor Author

I think this is ready to go. Willing to be told to split this into two PRs, one fixing the wxPython issues and one fixing the Pyface issues.

@kitchoi kitchoi self-requested a review May 4, 2020 10:53
Copy link
Contributor

@kitchoi kitchoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One question related where logic flow has changed and I am not sure if that was intended.

(Feel free to ignore the nitpicks)

@@ -33,14 +21,7 @@
__version__ = QT_VERSION_STR
__version_info__ = tuple(map(int, QT_VERSION_STR.split(".")))


elif qt_api == "pyside2":
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting an observation: It is not necessary (though would be defensive) to check qt_api is "pyside2" here again because pyface.qt.__init__ already ensures qt_api must be one of "pyside2" and "pyqt5". I also noticed that the order of these if-else branches are consistent with the reverse order of QtAPIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is OK to do this, since Pyside2 is the blessed Python Qt wrapper provided by the Qt Company. If a new wrapper cam along it would likely follow the Pyside conventions more than the PyQt conventions.

@@ -18,17 +18,6 @@
from pyface.base_toolkit import Toolkit
from .gui import GUI

if qt_api == "pyqt":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 flake ❄️ : I can't see qt_api QtCore being used anywhere... So they are now unused imports?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check. There are a few things done in the init.py to make sure that we have a valid environment and Qt has been initialized to a working state. It is possible QtCore is imported just to prove it can be.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope - it's redundant. Will remove.

"pyside2": {"ETS_TOOLKIT": "qt4", "QT_API": "pyside2"},
"pyqt": {"ETS_TOOLKIT": "qt4", "QT_API": "pyqt"},
"pyqt5": {"ETS_TOOLKIT": "qt4", "QT_API": "pyqt5"},
"pyqt": {"ETS_TOOLKIT": "qt4", "QT_API": "pyqt5"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit and subjective: I would prefer seeing "pyqt5" in the environment name so that wherever I see "pyqt" in CI logs etc I know it is the old Qt4 being used.

Unrelated drive-by comment: This ETS_TOOLKIT looks sadly inconsistent :( "qt4" does not mean "qt4" anymore, it just means Qt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-mortem: It is painful when an old environment name is reused for a new meaning and then that change has to be reverted later. Let's not do this again.

@@ -302,7 +302,7 @@ def _focus_changed(self, old, new):
# It is possible for the C++ layer of this object to be deleted between
# the time when the focus change signal is emitted and time when the
# slots are dispatched by the Qt event loop. This may be a bug in PyQt4.
if qt_api == "pyqt":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch only runs for PyQt but not PyQt5, now it runs for PyQt5 too, is this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It's harmless for PyQt5 if the mentioned bug has been fixed, but it will protect if it has not.

@corranwebster corranwebster merged commit b149f5f into master May 11, 2020
@corranwebster corranwebster deleted the enh/no-pyqt4-pyside-etstool branch May 11, 2020 13:51
@mdickinson mdickinson changed the title Remove PyQt4 and PySide from CI Remove PyQt4 and PySide support May 14, 2020
@mdickinson
Copy link
Member

I retitled the PR; the original title misled me, since it suggested that this was just about CI changes, not about user-facing changes.

@corranwebster corranwebster mentioned this pull request May 14, 2020
@corranwebster corranwebster restored the enh/no-pyqt4-pyside-etstool branch May 14, 2020 10:58
corranwebster added a commit that referenced this pull request May 14, 2020
@corranwebster corranwebster mentioned this pull request May 14, 2020
corranwebster added a commit that referenced this pull request May 15, 2020
* Revert "Remove PyQt4 and PySide from CI (#512)"

This reverts commit b149f5f.

* Fix bad merge.

* Fix for wxPython versions.

* Fix typo and match commands exactly.
@rahulporuri rahulporuri deleted the enh/no-pyqt4-pyside-etstool branch July 13, 2020 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants